

.PHONY: test all data print restore
PYTHON=python2.3

all: dataviacommands
	echo "nothing."

import:
	source setup.bash && $(PYTHON) scripts/import-data-from-dump.py

dataviacommands:
	source setup.bash && $(PYTHON) scripts/make-data-via-commands.py

data:
	source setup.bash && $(PYTHON) scripts/make-data.py

articles:
	source setup.bash && $(PYTHON) scripts/make-article.py "Guided activist.ca Tour" docs/help-guide None /help /help/moderators /help/guide
	source setup.bash && $(PYTHON) scripts/make-article.py "Moderation of activist.ca" docs/help-moderators /help/guide /help /help/about /help/moderators
	source setup.bash && $(PYTHON) scripts/make-article.py "About activist.ca" docs/help-about /help/moderators /help None /help/about
	source setup.bash && $(PYTHON) scripts/make-article.py "activist.ca Help" docs/help None / None /help
	source setup.bash && $(PYTHON) scripts/make-article.py "Posting Comments" docs/help-posting-comments None /help None /help/comments

print:
	source setup.bash && ./scripts/print-commands.py
step:
	source setup.bash && ./scripts/step-commands.py

test:
	#source setup.bash && ./scripts/test_newcommand.py
	#source setup.bash && ./scripts/test_time.py
#	source setup.bash && ./scripts/test_commands.py
	source setup.bash && py.test src/activist/test_backend.py

test2: clean
	source setup.bash && trial activist.service && trial activist.command

sucklistings:
	./scripts/suck-listings.py

test_command: clean
	source setup.bash && trial activist.command

run: all
	source setup.bash && twistd -ny src/activist/activist.tac

restore:
	source setup.bash && twistd -ny src/activist/activist-restart.tac

restoretest: dataviacommands
	source setup.bash && twistd -ny src/activist/activist-restart.tac

clean:
	-rm `find . -name \*~`
	-rm data/datastore
	-rm data/objects/*
	-rm -rf data/commands.log
	mkdir data/commands.log
